/*
 * @Descripttion:
 * @Author: liujing
 * @Date: 2021-04-20 11:04:26
 * @LastEditTime: 2021-09-03 16:54:22
 */
import {
  createStackNavigator,
  CardStyleInterpolators,
} from "@react-navigation/stack";
import { createMaterialTopTabNavigator } from "@react-navigation/material-top-tabs";
import { Dimensions } from "react-native";
import React from "react";
import HomePage from "../pages/home";
import LoginPage from "../pages/login/login";
import SecondPage from "../pages/SecondPage";
import Type from "../pages/Type";
import tabFirst from "../pages/tab/tabFirst";
import tabSecond from "../pages/tab/tabSecond";
import tabThird from "../pages/tab/tabThird";
import Product from "../pages/product/product";
import checkList from "../pages/check/CheckFirst";
const MainStack = createStackNavigator();
const Tab = createMaterialTopTabNavigator();
const { width } = Dimensions.get("window");

export const HomeTabApp = () => {
  return (
    <Tab.Navigator
      style={{ borderTopLeftRadius: 12, borderTopRightRadius: 12 }}
      tabBarOptions={{ tabStyle: { width: (1 / 3) * width } }}
    >
      <Tab.Screen name="中长期出口信用保险" component={tabFirst} />
      <Tab.Screen name="海外投资保险" component={tabSecond} />
      <Tab.Screen name="短期出口信用保险" component={tabThird} />
    </Tab.Navigator>
  );
};

export const MainStackScreen = () => {
  return (
    <MainStack.Navigator
      screenOptions={{
        cardStyleInterpolator: CardStyleInterpolators.forHorizontalIOS,
        header: () => null,
      }}
      initialRouteName={"LoginPage"}
    >
      <MainStack.Screen name={"LoginPage"} component={LoginPage} />
      <MainStack.Screen name={"HomePage"} component={HomePage} />
      <MainStack.Screen name={"SecondPage"} component={SecondPage} />
      <MainStack.Screen name={"Type"} component={Type} />
      <MainStack.Screen name={"Product"} component={Product} />
      <MainStack.Screen name={"checkList"} component={checkList} />
    </MainStack.Navigator>
  );
};
exports.default = MainStackScreen;
